package com.df.happylearn.sqlite;

import android.content.Context;

import com.df.happylearn.application.MyApplication;
import com.df.happylearn.model.Article;

public class Helper {
    private Context mContext;

    private BaseDao<Article, Integer> mArticleDao;

    private static Helper dbUtil = null;

    public static Helper getInstance() {
        if (dbUtil == null) {
            dbUtil = new Helper(MyApplication.getInstance());
        }
        return dbUtil;
    }

    public Helper(Context context) {
        mContext = context;
    }

    public BaseDao<Article, Integer> getArticleDao() {
        if (mArticleDao == null) {
            mArticleDao = new BaseDaoImpl<>(mContext, Article.class);
        }
        return mArticleDao;
    }


}
